<template>
  <div id="contractDetail">
    <el-form :model="data" label-width="100">
      <el-form-item label="编号:">
        <p>{{ data.purchaseCode }}</p>
      </el-form-item>
      <el-form-item label="标题:">
        <p>{{ data.title }}</p>
      </el-form-item>
      <el-form-item label="部门:">
        <p>{{ data.departmentName }}</p>
      </el-form-item>
      <el-form-item label="请购人:">
        <p>{{ data.adminName }}</p>
      </el-form-item>
      <el-form-item label="经办人:">
        <p>{{ data.operatorName }}</p>
      </el-form-item>
      <el-form-item label="请购明细:" style="width: 100%">
        <el-table
          ref="table"
          row-key="id"
          :data="data.requisitionProductList"
          border
          :header-cell-style="{ background: '#f5f7fa' }"
        >
          <el-table-column label="物品名称" prop="productName">
          </el-table-column>
          <el-table-column label="规格型号" prop="specificationName">
          </el-table-column>
          <el-table-column label="单价(元)" prop="price"> </el-table-column>
          <el-table-column label="请购数量" prop="productBuyNum">
          </el-table-column>
          <el-table-column label="单位" prop="unitName"> </el-table-column>
          <el-table-column label="总价格(元)" prop="productBuyPrice">
          </el-table-column>
        </el-table>
      </el-form-item>
      <el-form-item label="备注:" style="width: 100%">
        <p>{{ data.remark }}</p>
      </el-form-item>

      <el-form-item label="创建时间:">
        <p>{{ data.createTime }}</p>
      </el-form-item>
      <el-form-item label="修改时间:" v-if="data.updateTime">
        <p>{{ data.updateTime }}</p>
      </el-form-item>
      <el-form-item label="审核状态:" v-if="isReloadData">
        <!-- 0，未审核，1,审核通过，2审核未通过-->
        <p v-if="data.status == 0">待审核</p>
        <p v-if="data.status == 1" style="color: #67c23a">通过</p>
        <p v-if="data.status == 2" style="color: #f56c6c">未通过</p>
        <p v-if="data.status == 3" style="color: #ff9b31">审核中</p>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  name: 'detail',
  data () {
    return {
      form: {},
      isReloadData: true//局部刷新标识
    }
  },
  props: {
    data: {
      type: Object,
      required: true
    }
  },
  methods: {
    relodPart () {
      this.isReloadData = false
      this.$nextTick(() => {
        this.isReloadData = true
      })
    }
  }

}
</script>
<style lang='scss' scoped>
</style>